import Vue from 'vue'
import Router from 'vue-router'


//import QuestionsIndex from '../pages/questions/questionsIndex.vue'

const QuestionsIndex = resolve => {
  require.ensure(['../pages/questions/questionsIndex.vue'], () => {
    resolve(require('../pages/questions/questionsIndex.vue'))
  })
}

const SchoolInfo = resolve => {
  require.ensure(['../pages/questions/schoolInfo.vue'], () => {
    resolve(require('../pages/questions/schoolInfo.vue'))
  })
}

const Answer = resolve => {
  require.ensure(['../pages/questions/answer.vue'], () => {
    resolve(require('../pages/questions/answer.vue'))
  })
}

const Score = resolve => {
  require.ensure(['../pages/questions/score.vue'], () => {
    resolve(require('../pages/questions/score.vue'))
  })
}

const Ranking = resolve => {
  require.ensure(['../pages/questions/ranking.vue'], () => {
    resolve(require('../pages/questions/ranking.vue'))
  })
}

const Share = resolve => {
  require.ensure(['../pages/questions/share.vue'], () => {
    resolve(require('../pages/questions/share.vue'))
  })
}

const SignIn = resolve => {
  require.ensure(['../pages/questions/signIn.vue'], () => {
    resolve(require('../pages/questions/signIn.vue'))
  })
}
const RewardList = resolve => {
  require.ensure(['../pages/questions/rewardList.vue'], () => {
    resolve(require('../pages/questions/rewardList.vue'))
  })
}

const LinkAddress = resolve => {
  require.ensure(['../pages/questions/address.vue'], () => {
    resolve(require('../pages/questions/address.vue'))
  })
}









Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/question/index',
      component: QuestionsIndex
    },
    {
      path: '/question/schoolInfo',
      component: SchoolInfo
    },
    {
      path: '/question/answer',
      component: Answer
    },
    {
      path: '/question/score',
      component: Score
    },

    {
      path: '/question/ranking',
      component: Ranking
    },
    {
      path: '/question/share',
      component: Share
    },
    {
      path: '/question/signIn',
      component: SignIn
    },
    {
      path: '/question/rewardList',
      component: RewardList
    },
    {
      path: '/question/linkAddress',
      component: LinkAddress
    },



    /*{
      path: '/',
      component: IndexPage,
      redirect: 'home',
      children: [
        {
          path: 'home',
          component: "",
        },
        {
          path: 'cart',
          component: "",
        }
      ]
    }*/

  ]
})
